#ifndef _PLUGINS_PROJECTMANAGER_
#define _PLUGINS_PROJECTMANAGER_
#include <QTreeView>
#include "Include/IProjectManager.h"

namespace Plugins
{
    class Project;
    class ProjectManagerPrivate;
    class IEditorsManager;
    class IConsole;
    class Q_GUI_EXPORT ProjectManager : public QTreeView, public IProjectManager
    {
        Q_OBJECT
        Q_INTERFACES(Plugins::IProjectManager)
    public:
        explicit ProjectManager(QWidget* parent = NULL);
        virtual ~ProjectManager();

        virtual Project* project();
        virtual void setEditorsManager(Plugins::IEditorsManager*);
        virtual QWidget *widget();
        virtual void projectRun(IConsole *console);

    signals:
        void projectAvailable(bool);
        void openFile(const QString& file, int offset = 0, bool offsetIsLine = false);
        void filesFound(QStringList files);
        void projectRunned(bool);
    public slots:
        void stopProject();
        void closeProject();
        void openProject();
        void newProject();
        void loadProject(const QString & path);
        void projectProperties();
        void fileActivated(const QString & path);
        void modifyChanged(const QString & fileName, bool m);
        void reloadTree();
        void navigateFile(const QString &file, int offset);
        void navigateFileLine(const QString &file, int line);
        void runFinished();
        void findInProject();
    private:
        ProjectManagerPrivate * const d_ptr;
        ProjectManager(ProjectManagerPrivate &dd, QWidget * parent);
        Q_DECLARE_PRIVATE(ProjectManager)
    };
}

#endif
